from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from mainapp.views import methods, modules, supervised_learning,\
    unsupervised_init, dm_result, supervised_test, unsupervised_load,\
    supervised_load
import os
from django.conf import settings
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^pracamgr2/', include('pracamgr2.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
     (r'^admin/', include(admin.site.urls)),
     
     url('^$', methods),
     url('^metody/$', methods, name="methods"),
     url('^moduly/$', modules, name="modules"),
     url('^supervised-uczenie/$', supervised_learning, name="supervised_learning"),
     url('^supervised-inicjowanie/$', supervised_test, name="supervised_test"),
     url('^unsupervised-inicjowanie/$', unsupervised_init, name="unsupervised_init"),
     url('^unsupervised-zaladowane/(?P<id>\d+)/$', unsupervised_load, name="unsupervised_load"),
     url('^supervised-zaladowane/(?P<id>\d+)/$', supervised_load, name="supervised_load"),
     url('^rezultat-(?P<id>\d+)/$', dm_result, name="dm_result"),
)


if settings.DEBUG:
    urlpatterns += patterns(
        '',
        (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': os.path.join(os.path.dirname(__file__), 'site_media'), 'show_indexes': True}),
)